<?php
$this->breadcrumbs=array(
	'Workflows'=>array('index'),
);

if ($workflow->id)
    $this->breadcrumbs = CMap::mergeArray($this->breadcrumbs, array($workflow->name=>array('update','id'=>$workflow->id),'Update'));
else
    $this->breadcrumbs[] = 'Create';
?>

<h1><?php echo ($workflow->id) ? 'Edit' : 'Create';?> Workflow <?php echo $workflow->name; ?></h1>

<div class="form wide">

<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'workflow-form',
)); ?>
<?php
$tabs = array(
    'Details'=>$this->renderPartial('_form', array('form'=>$form, 'model'=>$workflow, 'workflows'=>$workflows, 'sites'=>$sites), true),
    );
//The tab Master layout is only shown when user Create new WorkFlow, So, it is hidden when user edit .

//if(!$workflow->id){
//     $tabs=CMap::mergeArray($tabs,
//            array('Master Layout'=>$this->renderPartial('_layout', array('form'=>$form, 'workflow'=>$workflow, 'masterLayouts'=>$masterLayouts, 'template'=>$template, 'templateContent'=>$templateContent, 'newRevision'=>$newRevision), true),
//    ));
//}
$this->widget('zii.widgets.jui.CJuiTabs', array(
    'id'=>'workflow-tabs',
    'tabs'=>$tabs,
));?>

<div class="row buttons">
    <?php echo CHtml::submitButton($workflow->isNewRecord ? 'Create' : 'Save'); ?>
</div>

<?php $this->endWidget(); ?>

</div><!-- form -->